package io.spring.nn.mapper;

import io.spring.nn.bean.Image;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ImageMapper {

    @Insert("insert into images(path,user_id) values(#{filePath},#{user_id})")
    public void insertImage(String filePath, int user_id);

    @Select("select path,datetime from images where user_id=#{user_id}")
    public List<Image> getAllPhoto(int user_id);

}
